package com.life.xylife.controller.account;

import com.life.xylife.controller.BaseAction;
import com.life.xylife.model.comm.bo.MsgResBo;
import com.life.xylife.service.account.IAccountService;
/**
 * 
 * @author 翔
 *
 */
public class AccountAction extends BaseAction
{
	private String workerNo;
	private String pwd;
	private IAccountService accountServiceImpl;
	
	public String getWorkerNo()
	{
		return workerNo;
	}
	public void setWorkerNo(String workerNo)
	{
		this.workerNo = workerNo;
	}
	public String getPwd()
	{
		return pwd;
	}
	public void setPwd(String pwd)
	{
		this.pwd = pwd;
	}
	public IAccountService getAccountServiceImpl()
	{
		return accountServiceImpl;
	}
	public void setAccountServiceImpl(IAccountService accountServiceImpl)
	{
		this.accountServiceImpl = accountServiceImpl;
	}


	/**
	 * 登陆系统
	 */
	public void login()
	{
	
		MsgResBo msgRes = null;
		try
		{
			msgRes = accountServiceImpl.save_verify_login(workerNo, pwd);
		} catch (Exception e)
		{
			e.printStackTrace();
		}
		super.writeObjDateJsonPFt(msgRes);
	}
	
	/**
	 * 退出系统
	 */
	public void logout()
	{
		MsgResBo msgRes = null;
		try
		{
			msgRes = accountServiceImpl.deleteSessionUser();
		} catch (Exception e)
		{
			e.printStackTrace();
		}
		super.writeObjDateJsonPFt(msgRes);
	}
	
	
}
